package com.peakmain.homemodule.utils;

import com.peakmain.homemodule.bean.SearchCityBean;

import java.util.Comparator;

/**
 * author ：Peakmain
 * createTime：2020/2/29
 * mail:2726449200@qq.com
 * describe：城市排序
 */
public class CityCompartor implements Comparator<SearchCityBean> {
    @Override
    public int compare(SearchCityBean o1, SearchCityBean o2) {
        if ("#".equals(o2.getSortLetters())) {
            return -1;
        } else if ("#".equals(o1.getSortLetters())) {
            return 1;
        } else {
            return o1.getSortLetters().compareTo(o2.getSortLetters());
        }
    }
}
